<div *ngIf="isModalShown" [config]="{ show: true }" (onHidden)="onHidden()"
     bsModal #bookingModal="bs-modal" class="modal fade login-modal-view wf-login-modal" tabindex="-1" role="dialog"
     aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-body">
        <div class="wf-modal-title">
          <div class="wf-watermark">EXCHANGE ROOM</div>
          <div class="text">申请换房</div>
        </div>
        <form class="login-form form-horizontal" [formGroup]="exchangeForm">
          <div class="form-group">
            <label class="col-sm-2 control-label">公寓</label>
            <div class="col-sm-10 select-box">
              <select name="apartment"
                      formControlName="apartment"
                     class="form-control" [(ngModel)]="currentApartmentId">
                <option *ngFor="let item of apartmentList" [value]="item.id">{{item.name}}</option>
              </select>
            </div>
          </div>
          <div class="form-group input-box">
            <label class="col-sm-2 control-label">房间号</label>
            <div class="col-sm-10">
              <input class="form-control" name="houseNo" formControlName="houseNo" placeholder="请输入房间号">
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-10 col-sm-offset-2">
              <button class="login-btn form-control bg-green" [disabled]="exchangeForm.get('apartment').value=='' || exchangeForm.get('houseNo').value=='' " (click)="doExchangeRoom()">
                申请换房
              </button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
<app-confirm-checkout-modal-view (modalClose)="closeConfirmCheckoutModal($event)"></app-confirm-checkout-modal-view>
